
\documentclass[pdftex, 
			   a4paper, 
			   12pt, lequo, 
			   final]{scrartcl}
\usepackage[style=footnote-dw, autocite=footnote]{biblatex}
\usepackage[german]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{listings}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{titlesec}
\usepackage{subfigure}
\usepackage{setspace}
\usepackage{listing}
\usepackage{listingsutf8}
\usepackage{color} 
\usepackage{colortbl}
\definecolor{gray}{rgb}{0.4,0.4,0.4} 
\definecolor{lightgray}{rgb}{0.95,0.95,0.95}
\definecolor{darkred}{rgb}{0.6,0.0,0.0} 
\definecolor{red}{rgb}{1.0,0.0,0.0} 
\definecolor{blue}{rgb}{0.0,0.0,1.0} 
\definecolor{darkblue}{rgb}{0.0,0.0,0.6} 
\definecolor{cyan}{rgb}{0.0,0.6,0.6}
\usepackage{color}
\usepackage{float}
\usepackage{array, ragged2e}
\usepackage{caption}
\usepackage{longtable}
\usepackage{beramono}
\usepackage{url}
\usepackage{eurosym}
\usepackage{geometry}
\usepackage{amsmath}
\usepackage[pdftex,
            pdfauthor={Philipp Stelzer \& David Maier},
            pdftitle={Edubot},
            pdfsubject={Diplomarbeit aus Prozessregelung mit Laborübungen},
            pdfproducer={LaTeX},
            pdfcreator={PDFLaTeX}]{hyperref}
\renewcommand{\familydefault}{\sfdefault}
\geometry{a4paper, left=3cm, right=3cm, top=2.5cm, bottom=2.5cm}
\bibliography{misc/references}

\definecolor{pink}{rgb}{1,.21,.86}

\lstset{
  basicstyle=\ttfamily,
  columns=fullflexible,
  showstringspaces=false,
  breaklines=true,
  commentstyle=\color{0.133,0.545,0.133}\upshape
}

\lstdefinelanguage{XAML}
{
  morestring=[b]",
  morestring=[b]{>}{<},
  morecomment=[s]{<?}{?>},
  stringstyle=\color{blue},
  identifierstyle=\color{darkred},
  keywordstyle=\color{red},
  morekeywords={xmlns,version,type,Grid.Row, Grid.Column, Margin, Width, Height, HorizontalAlignment, VerticalAlignment, IsEnabled, Name, Path, UpdateSourceTrigger}% list your attributes here
} 

\lstdefinelanguage{codesysls}
{
	sensitive=true,
morekeywords=[1]{ ,
CASE, OF, IF, END_IF, ELSIF, THEN, END_CASE, AND, OR, VAR, VAR_IN, DINT, INT, LREAL, PROGRAMM, END_VAR, FUNCTION, FUNCTION_BLOCK},
morekeywords=[2]{,TRUE,FALSE},
keywordstyle=[1]\color{blue},
keywordstyle=[2]\color{pink},
morecomment=[s]{(*}{*)},
}

\lstdefinelanguage{CSharp}
{
  sensitive=true,
morekeywords=[1]{ ,
abstract, as, base, break, case,
catch, checked, class, const, continue,
default, delegate, do, else, enum,
event, explicit, extern, false,
finally, fixed, for, foreach, goto, if,
implicit, in, interface, internal, is,
lock, namespace, new, null, operator,
out, override, params, private,
protected, public, readonly, ref,
return, sealed, sizeof, stackalloc,
static, struct, switch, this, throw,
true, try, typeof, unchecked, unsafe,
using, virtual, volatile, while, bool,
byte, char, decimal, double, float,
int, lock, object, sbyte, short, string,
uint, ulong, ushort, void},
morekeywords=[2]{,ICommand, AbortCommand, StartCommand, ShutdownCommand, MVSCommand, MVCCommand, UseToolCommand, IAdapter, EdubotAdapter, VirtualAdapter, Cursors, FileStream, XmlSerializer, UnauthorizedAccessException, FileMode, MessageBox, MessageBoxButton, MessageBoxImage, Point3D, Math, MathHelper, Event, EventArgs, HomingEventArgs, MovementStartedEventArgs, ToolUsedEventArgs, FailureEventArgs, StateChangedEventArgs, List, ThreadAbortException, State, KeyValuePair, StrokeCollection, Memento, InkCanvasStrokeCollectedEventArgs, StylusPoint, StylusPointCollection, Point, InterpolationType, Path,}
keywordstyle=[1]\color{blue},
keywordstyle=[2]\color{cyan},
morecomment=[l]{//},
morecomment=[s]{/*}{*/},
morestring=[b]",
morestring=[b]'
}

%Bibliography Style
\DeclareBibliographyDriver{misc}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  %\printtext{\printnames{labelname}}
  \usebibmacro{author/editor+others/translator+others}%
  \setunit{\labelnamepunct}\newblock
  \usebibmacro{title}%
  \setunit{. }\newblock
  \printfield{year}%
  \setunit{. }\newblock
  \printfield{note}%
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \usebibmacro{finentry}}

\DeclareBibliographyDriver{book}{%
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/editor+others/translator+others}%
  \setunit{\labelnamepunct}\newblock
  \usebibmacro{maintitle+title}%
  \setunit{. - }\newblock
  \printlist{location}%
  \setunit{\labelnamepunct}\newblock
  \printlist{publisher}
  \printfield{year}%
  \printtext{. }
  \newunit\newblock
  \usebibmacro{chapter+pages}%
  \newunit
  \printfield{pagetotal}%
  \newunit\newblock
  \iftoggle{bbx:isbn}
    {\printfield{isbn}}
    {}%
  \newunit\newblock
  \usebibmacro{doi+eprint+url}%
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \usebibmacro{finentry}}
  
  \newbibmacro*{cite}{% 
  	\ifciteseen{
    	   \printtext{\printnames{labelname} \printfield{year}}
       }{
       \printtext{% 
          \usedriver 
          {\DeclareNameAlias{default}{sortname}} 
          {\thefield{entrytype}}}% 
       }}



%pdf metatags

%caption of pictures (skip)
\captionsetup{aboveskip=10pt}

%caption of figures
\renewcommand{\captionfont}{\small}

\newcommand{\titleformatsection}[1]
		   {\titleformat{\section}
		   {\normalfont\LARGE\bfseries}
		   {\thesection}{1em}{#1}}
\newcommand{\titleformatsubsection}[1]
		   {\titleformat{\subsection}
		   {\normalfont\Large\bfseries}
		   {\thesubsection}{1em}{#1}}
\newcommand{\titleformatsubsubsection}[1]
		   {\titleformat{\subsubsection}
		   {\normalfont\large\bfseries}
		   {\thesubsubsection}{1em}{#1}}
		   
\titleformat{\paragraph}[hang]{\normalfont\bfseries}{}{0pt}{}
\titleformat{\subparagraph}[hang]{\normalfont\bfseries}{}{0pt}{}
\titlespacing{\paragraph}{0mm}{5pt}{4pt}
\titlespacing{\subparagraph}{0mm}{3pt}{2pt}

\newenvironment{myitemize}
			   {\begin{itemize}\itemsep0.0pt\parskip1.0ex}
			   {\end{itemize}\parskip1.5ex}
			   
\newcolumntype{C}[1]{>{\Centering}m{#1}}

%setting up the code listings
\definecolor{listinggray}{gray}{0.9}
\definecolor{lightblue}{rgb}{0.0,0.0,0.5}
\definecolor{lightgreen}{rgb}{0.0,0.5,0.0}
\lstset{numbers=left}
\lstset{numberstyle=\footnotesize\ttfamily}
\lstset{numbersep=5pt} 
\lstset{language=[SHARP]C}
\lstset{backgroundcolor=\color{listinggray}}
\lstset{basicstyle=\footnotesize\ttfamily}
\lstset{keywordstyle=\color{lightblue}}
\lstset{commentstyle=\color{blue}}
\lstset{stringstyle=\color{lightgreen}}
\lstset{morecomment=[s][\color{blue}]{/*}{*/}}




%say latex that listings are atomar
\newfloat{makeatomar}{tp}{lot}[section]

%!!! IMPORTANT FOR TEXT FLOW !!!
\raggedbottom

%\setlength{\evensidemargin}{0.76cm}
%\setlength{\oddsidemargin}{-0.54cm}
	
\parskip1.5ex
\parindent0.0ex
%
% EoF
%